package cn.jsu.oj.dispatchServer.pojo;

import cn.jsu.oj.dispatchServer.parsing.NoSerialize;
import cn.jsu.oj.dispatchServer.parsing.PackType;

/**
 * @author: suixuexue
 * @date: 2020/11/11 21:01
 * describe:
 *                 判题机的解包顺序
 *      *          1.langVer
 *      *          2.mod
 *      *          3.tId
 *      *          4.sNumber
 *      *          5.code.cpp
 *      *          6.time
 *      *          7.memory
 */
@PackType(typeNo = 12)
public class TaskInfo extends AbstractPack {

    //任务是否是优先任务
//    @NoSerialize
    private boolean taskPriority;

    //语言类型
    private byte languageType;

    //判题模式
    private byte judgeModel;

    //题目ID
    private String subjectID;

    //流水号
    private long serialNumber;

    ///源代码
    private String sourceCode;

    //任务权值
//    @NoSerialize
    private int taskWeight;

    //最大运行时间
    private int maxRunningTime;

    //最大运行内存kb
    private int maxRunningMemory;

    public TaskInfo() {
    }

    @Override
    public String toString() {
        return "TaskInfo{" +
                "taskPriority=" + taskPriority +
                ", languageType=" + languageType +
                ", judgeModel=" + judgeModel +
                ", subjectID=" + subjectID +
                ", serialNumber=" + serialNumber +
                ", sourceCode='" + sourceCode + '\'' +
                ", taskWeight=" + taskWeight +
                ", maxRunningTime=" + maxRunningTime +
                ", maxRunningMemory=" + maxRunningMemory +
                '}';
    }

    public TaskInfo(boolean taskPriority) {
        this.taskPriority = taskPriority;
    }

    public TaskInfo(boolean taskPriority, byte languageType, byte judgeModel, String subjectID, long serialNumber, String sourceCode, int taskWeight, int maxRunningTime, int maxRunningMemory) {
        this.taskPriority = taskPriority;
        this.languageType = languageType;
        this.judgeModel = judgeModel;
        this.subjectID = subjectID;
        this.serialNumber = serialNumber;
        this.sourceCode = sourceCode;
        this.taskWeight = taskWeight;
        this.maxRunningTime = maxRunningTime;
        this.maxRunningMemory = maxRunningMemory;
    }

    public String getSubjectID() {
        return subjectID;
    }

    public void setSubjectID(String subjectID) {
        this.subjectID = subjectID;
    }

    public boolean isTaskPriority() {
        return taskPriority;
    }

    public void setTaskPriority(boolean taskPriority) {
        this.taskPriority = taskPriority;
    }

    public byte getLanguageType() {
        return languageType;
    }

    public void setLanguageType(byte languageType) {
        this.languageType = languageType;
    }

    public byte getJudgeModel() {
        return judgeModel;
    }

    public void setJudgeModel(byte judgeModel) {
        this.judgeModel = judgeModel;
    }

    public long getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(long serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getSourceCode() {
        return sourceCode;
    }

    public void setSourceCode(String sourceCode) {
        this.sourceCode = sourceCode;
    }

    public int getTaskWeight() {
        return taskWeight;
    }

    public void setTaskWeight(int taskWeight) {
        this.taskWeight = taskWeight;
    }

    public int getMaxRunningTime() {
        return maxRunningTime;
    }

    public void setMaxRunningTime(int maxRunningTime) {
        this.maxRunningTime = maxRunningTime;
    }

    public int getMaxRunningMemory() {
        return maxRunningMemory;
    }

    public void setMaxRunningMemory(int maxRunningMemory) {
        this.maxRunningMemory = maxRunningMemory;
    }
}
